<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class AdminMiddleware
{
    public function handle(Request $request, Closure $next)
    {
        // 检查用户是否登录
        if (!$request->user()) {
            return redirect()->route('login');
        }

        // 所有登录用户都可以访问管理后台
        return $next($request);
    }
} 